<html>
<head>
<title>Silahkan Login Dahulu</title>
<link rel="shortcut icon" href="../icon/quote.png"><!-- Pemanggilan gambar favicon-->
<link rel="stylesheet" type="text/css" href="../css/global.css"> <!--pemanggilan file css-->
</head>

<body>
<div id="loginForm">
	<div class="headLoginForm">
	Login
	</div>
	<div class="fieldLogin">
	<form method="post" action="">
			<label>Username</label><br>
			<input type="text" class="login" name="user"/><br>
			<label>Password</label><br>
			<input type="password" class="login" name="pass"/><br>
			<input type="submit" class="logintombol" value="Login">
		</form>
	</div>
</div>
</body>
</html>

<?php
	include('fungsi_admin.php');
	if(!empty($_POST)){
		session_start();
		if(masuk(mysql_real_escape_string($_POST['user']), mysql_real_escape_string($_POST['pass']))){
		$_SESSION['user'] = $_POST['user'];
			echo "<script>
				window.location = '../admin/dashboard.php';
				</script>";
		}else{
			echo "<script>
			alert('username atau password salah');
			window.location = '../admin/index.php';
	</script>";
		}
	}
	?>